package com.userautentification.dao.imp;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Session;
import org.hibernate.Transaction;

import com.userautentification.dao.DataAccessLayerException;
import com.userautentification.dao.HibernateFactory;
import com.userautentification.dao.RoleDao;
import com.userautentification.entities.Role;

public class RoleDaoImp extends GenericDaoHibernate<Role, Long> implements
		RoleDao {

	Log log = LogFactory.getLog(RoleDaoImp.class);

	public RoleDaoImp() {
		HibernateFactory.buildIfNeeded();
	}

	/**
	 * Insert a new Event into the database.
	 * 
	 * @param event
	 */
	public void create(Role event) throws DataAccessLayerException {
		super.create(event);
	}

	/**
	 * Delete a detached Event from the database.
	 * 
	 * @param event
	 */
	public void delete(Role event) throws DataAccessLayerException {
		super.delete(event);
	}

	/**
	 * Find an Event by its primary key.
	 * 
	 * @param id
	 * @return
	 */
	public Role find(Long id) throws DataAccessLayerException {
		return (Role) super.find(Role.class,id);
	}

	/**
	 * Updates the state of a detached Event.
	 * 
	 * @param event
	 */
	public void update(Role role) throws DataAccessLayerException {
		super.update(role);
	}

	/**
	 * Finds all Events in the database.
	 * 
	 * @return
	 */
	public List findAll() throws DataAccessLayerException {
		return super.findAll(Role.class);
	}

}